package com.epam.task.web.app;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * zhunusbekova.arailym
 */

public class ConnectionToDB {
    public static final Logger LOGGER = LoggerFactory.getLogger(ConnectionToDB.class);

    public static void main(String[] args) {
        Connection con = null;
        try {
            Class.forName("org.gjt.mm.mysql.Driver");
            con = DriverManager.getConnection("jdbc:mysql://localhost/biosfera", "root", "Hf[bv;fyjd111");
            System.out.println("Соединение установлено.");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (con != null) con.close();
                ;
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}



